<template>
	<view>
		<u-toast ref="uToast"></u-toast>
		<view class="">
			<view class="head" @click="tologin" v-if="!userinfo">
				<image style="height: 110rpx;width: 110rpx;border-radius: 50%;"
					src="../../static/img/user-deft.0d03181.png" mode=""></image>
				<text style="color: #fdecef;font-size: 28rpx;margin-top: 20rpx;">登录/注册</text>
			</view>
			<view class="head" v-else>
				<image style="height: 110rpx;width: 110rpx;border-radius: 50%;"
					src="../../static/img/user-deft.0d03181.png" mode=""></image>
				<text style="color: #fdecef;font-size: 28rpx;margin-top: 20rpx;">{{userinfo.nickname}}</text>
			</view>
		</view>
		<view class=""
			style="background-color: #f9f5fb;height:80vh;padding-top: 30rpx;border-radius: 20rpx;margin-top: -20rpx;">
			<view class="vip">
				<image style="height: 70rpx;width: 70rpx;margin-left: 20rpx;" src="../../static/img/ss.png" mode="">
				</image>
				<view class="" @click="showerro"
					style="font-size: 30rpx;display: flex;flex-direction: column;margin-left: 30rpx;color: #924700;">
					<text>开通会员</text>
					<text style="color: #e74c5b;font-size: 20rpx;margin-top: 10rpx;">月卡会员 尊享20大权益</text>
				</view>
				<view class="" style="    color: #924700;padding: 20rpx;margin-left: 230rpx;
					font-size: 20rpx;
					border-radius: 40rpx;
			line-height: 1em;
			background: #fed289;">
					立即开通
				</view>
			</view>
			<view class="box1" @click="showerro" v-if="false">
				<view class="boxs-tim">
					<text style="    font-size: 4.8vw;
			color: #333;
			margin-bottom: 0.033vw;">0</text>
					<view class="" style="display: flex;flex-direction: row;align-items: center;">
						<image src="../../static/img/卡券包.png" style="width: 30rpx;height: 30rpx;margin-right: 10rpx;"
							mode=""></image>
						<text style="    font-size: 3.2vw;
			color: #333;">雷速币</text>
					</view>
				</view>
				<view class="boxs-tim">
					<text style="    font-size: 4.8vw;
						color: #333;
						margin-bottom: 0.033vw;">0</text>
					<view class="" style="display: flex;flex-direction: row;align-items: center;">
						<image src="../../static/img/钱币符号.png" style="width: 35rpx;height: 35rpx;margin-right: 10rpx;"
							mode=""></image>
						<text style="    font-size: 3.2vw;
						color: #333;">金币</text>
					</view>
				</view>
				<view class="boxs-tim">
					<text style="    font-size: 4.8vw;
									color: #333;
									margin-bottom: 0.033vw;">0</text>
					<view class="" style="display: flex;flex-direction: row;align-items: center;">
						<image src="../../static/img/020_卡券.png" style="width: 35rpx;height: 35rpx;margin-right: 10rpx;"
							mode=""></image>
						<text style="    font-size: 3.2vw;
									color: #333;">卡券</text>
					</view>
				</view>
				<view class="boxs-tim" @click="showerro">
					<image src="../../static/img/钱包.png" style="width: 45rpx;height: 45rpx;margin-bottom: 10rpx;"
						mode=""></image>
					<view class="" style="display: flex;flex-direction: row;align-items: center;">

						<text style="    font-size: 3.2vw;
												color: #333;">我的钱包</text>
					</view>
				</view>
			</view>


			<view class="box1" @click="showerro">
				<view class="boxs-tim">
					<image src="../../static/img/记录.png" style="width: 45rpx;height: 45rpx;margin-bottom: 10rpx;"
						mode=""></image>
					<view class="" style="display: flex;flex-direction: row;align-items: center;">

						<text style="    font-size: 3.2vw;
												color: #333;">记录</text>
					</view>
				</view>
				<view class="boxs-tim">
					<image src="../../static/img/商城1.png" style="width: 45rpx;height: 45rpx;margin-bottom: 10rpx;"
						mode=""></image>
					<view class="" style="display: flex;flex-direction: row;align-items: center;">

						<text style="    font-size: 3.2vw;
												color: #333;">商城</text>
					</view>
				</view>
				<view class="boxs-tim">
					<image src="../../static/img/意见反馈.png" style="width: 45rpx;height: 45rpx;margin-bottom: 10rpx;"
						mode=""></image>
					<view class="" style="display: flex;flex-direction: row;align-items: center;">

						<text style="    font-size: 3.2vw;
												color: #333;">意见反馈</text>
					</view>
				</view>
				<view class="boxs-tim">
					<image src="../../static/img/客服.png" style="width: 45rpx;height: 45rpx;margin-bottom: 10rpx;"
						mode=""></image>
					<view class="" style="display: flex;flex-direction: row;align-items: center;">

						<text style="    font-size: 3.2vw;
												color: #333;">联系客服</text>
					</view>
				</view>
			</view>
			<view class="box2" style="margin-top: 30rpx;" :border="false" rightIcon="arrow-right">
				<u-cell-group style="background-color: #fff;">
					<u-cell @click="showerro" title="下载APP"></u-cell>
					<u-cell @click="showerro" title="商务合作"></u-cell>
					<u-cell title="退出登录" @click="tuichu"></u-cell>
				</u-cell-group>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo: ''
			}
		},
		onShow() {
			this.userinfo = uni.getStorageSync("userinfo")
			console.log(this.userinfo)
		},
		methods: {
			tuichu() {
				this.userinfo = ''
				uni.removeStorageSync("utoken")
				uni.removeStorageSync("userinfo")
				this.$refs.uToast.show({
					type: 'sucess',
					duration: '1000',
					position: 'top',
					message: '退出成功!',
					complete() {

					}
				})

			},
			showerro() {
				this.$refs.uToast.show({
					type: 'error',
					duration: '1000',
					position: 'top',
					message: '功能开发中,敬请期待!',
					complete() {

					}
				})
			},
			tologin() {
				uni.navigateTo({
					url: '/pages/login/login'
				})
			}
		}
	}
</script>

<style lang="scss">
	.head {
		width: 100%;
		height: 330rpx;
		background-image: url(@/static/img/user-bg.3ba4df5.png);
		background-size: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.vip {
		width: 95%;
		height: 130rpx;
		margin: 0 auto;
		border-radius: 20rpx;
		background-image: url(@/static/img/m_vippp.9a08dba.png);
		background-repeat: no-repeat;
		background-size: 100%;
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.box1 {
		width: 95%;
		margin: 0 auto;
		margin-top: 20rpx;
		background-color: #ffffff;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 30rpx 50rpx;
		box-sizing: border-box;
		border-radius: 20rpx;
		padding-bottom: 50rpx;

		.boxs-tim {
			border-radius: 20rpx;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			margin-top: 20rpx;
		}
	}

	/* App.vue */
	.cell-hover-class {}

	/* 或者单是设置透明度 */
	.cell-hover-class {
		opacity: 0.5;
	}
</style>